package com.starrtc.demo.imclient.clientCommand;

public class ChatConsole implements console {

    public static ChatConsole instance;

    public static ChatConsole getInstance(){
        if(instance == null){
            instance = new ChatConsole();
        }
        return instance;
    }

    private ChatConsole(){

    }

    private String toUserId;
    private String message;
    public static final String KEY = "2";

    @Override
    public void exec(String s) {
        System.out.println("请输入聊天信息，格式为：内容@用户名 ");
        String[] array = s.split("@");

        message = array[0];
        toUserId = array[1];
//        log.info("发送的目标用户:{},发送内容:{}",toUserId,message);
   }


    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public String getTip() {
        return "聊天";
    }

    public String getToUserId() {
        return toUserId;
    }

    public void setToUserId(String toUserId) {
        this.toUserId = toUserId;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String getKEY() {
        return KEY;
    }
}
